<template>
    <div class="container">
        <div>{{progress}}</div>
        <div
        >
            <circle-progress :list='progress'></circle-progress>
        </div>
        <modal :visible.sync="CreateVisible" :options="CreateOptions" @Confirm="ConfirmCreateHandler" @Cancel='CancelHandler'>
            <div slot="body">请确认提交,对话内容11111111111111111111111111</div>
        </modal>
        <!-- <div></div> -->
    </div>
</template>
<script>
 /* eslint-disable */
import circleProgress from '../components/circleProgress.vue'   // 组件路径
import modal from '../common/modal.vue'
export default {
    components: {
        circleProgress,
        modal
    },
    data () {
        return {
            data:'',
            // progerssList: [
            //     { "progress": 100 },
            //     { "progress": 20, "jindu": 20 },
            //     { "progress": 30, "jindu": 30 },
            //     { "progress": 35, "jindu": 35 },
            //     { "progress": 6, "jindu": 6 },
            //     { "progress": 5, "jindu": 5 },
            //     { "progress": 40, "jindu": 40 },
            //     { "progress": 7, "jindu": 7 }
            // ],
            totalTime: 6,  // 倒计时6000 毫秒
            netxTime:0,
            // progress:0,
            Time:0,
            CreateVisible:false,
            CreateOptions:{
                 title: '温馨提示',
                    text: '请确认提交',
                    showCancelButton: true,
                    cancelButtonClass:true,
                    cancelButtonText: '取消',
                    showConfirmButton: true,
                    confirmButtonClass:true,
                    confirmButtonText: '确定'
            }
        }
    },
    computed: {
        progress () {
            return ((this.netxTime/this.totalTime)) *100
        }
    },
    created () {
        this.countDown()
     },
    methods: {
        // 倒计时
        countDown () {
            let clock = window.setInterval(() => {
                this.netxTime ++ 
                if(this.netxTime >= 6) {
                    this.netxTime = 6
                    clearInterval(clock)
                }
            }, 1000)
        },
        // 取消
        CancelHandler(val) {
            this.CreateVisible = val
        },
        // 确定
        ConfirmCreateHandler (val) {
            this.CreateVisible = val
        }
    }
}
</script>
 